package com.mz.ozy.widget.dialog;

import android.app.Activity;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;

import com.mz.ozy.R;
import com.mz.ozy.bean.LotteryBean;
import com.mz.ozy.utils.Utils;

public class LotteryWinDialog extends BaseDialog implements View.OnClickListener {

    private TextView mTvLotteryNum;

    public LotteryWinDialog(Activity mContext) {
        super(mContext, R.layout.dialog_lottery_win, Gravity.TOP, true, true);
        initView();
    }

    private void initView() {
        mTvLotteryNum = getView(R.id.tv_lottery_num);
        setOnViewClick(R.id.deleteIv, this);
        setOnViewClick(R.id.iv_sure_know, this);
    }

    @Override
    public void onClick(View v) {
        mListener.onConfirm(v.getId());
    }

    private onDialogListener mListener;

    public void setOnDialogListener(onDialogListener listener) {
        mListener = listener;
    }

    public void setBean(LotteryBean bean) {
        final double amt = Double.parseDouble(bean.getAmt());
        mTvLotteryNum.setText(Utils.subTwoNumber(amt));
    }

    public interface onDialogListener {
        void onConfirm(int id);
    }
}
